﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Platform.Hardware.ControlCard.Base
{
    public static class IOTypeExtension
    {
        /// <summary>
        /// 获取IO点枚举项的下标值
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static int GetIndex(this IOType type)
        {
            var array = Enum.GetValues(type.GetType()) as IList;
            int index = array.IndexOf(type);
            return index;
        }
    }
}
